﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MobileSales.Model.Documents;
using MobileSales.Model.Exceptions;

namespace MobileSales.Server.Services
{
    [ServiceContract]
    public interface IDocumentService
    {
        #region Document management

        [OperationContract]
        Document GetDocument(int documentId);
        [OperationContract]
        IEnumerable<Document> GetDocumentList();
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StoreDocument(Document document);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void DeleteDocument(int documentId);
        [OperationContract]
        Document CreateDocumentFromOrder(int orderId);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void Pay(int documentId);

        #endregion

        #region Document element management

        //[OperationContract]
        //DocumentElement GetDocumentElement(int documentElementId);
        //[OperationContract]
        //IEnumerable<DocumentElement> GetDocumentElementList(int documentId);
        //[OperationContract]
        //void StoreDocumentElement(DocumentElement documentElement);
        //[OperationContract]
        //void DeleteDocumentElement(int documentElementId); 

        #endregion

        #region Payment method management

        [OperationContract]
        PaymentMethod GetPaymentMethod(int paymentMethodId);
        [OperationContract]
        IEnumerable<PaymentMethod> GetPaymentMethodList();
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StorePaymentMethod(PaymentMethod paymentMethod);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void DeletePaymentMethod(int paymentMethodId); 

        #endregion

        #region Document type management

        [OperationContract]
        DocumentType GetDocumentType(int documentTypeId);
        [OperationContract]
        IEnumerable<DocumentType> GetDocumentTypeList();
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void StoreDocumentType(DocumentType documentType);
        [OperationContract]
        [FaultContract(typeof(ValidationException))]
        void DeleteDocumentType(int documentTypeId); 

        #endregion
    }
}
